<extend name="Layout/ins_page" />
<block name="content">
	<input type="hidden" id="ajax" name="ajax" value="0">
	{:W('PageHeader/simple',array('name'=>'编辑文档'))}
	<div class="sub-frame gray">
		<form method='post' id="form_data" name="form_data" enctype="multipart/form-data">
			<input type="hidden" id="id" name="id" value="{$vo.id}">
			<input type="hidden" id="opmode" name="opmode" value="edit">
			<div class="layui-form-item">
				<label class="layui-form-label" for="name">文件名*：</label>
				<div class="layui-input-block">
					<input class="layui-input" type="text" id="name" name="name" check='required' info='请输入文件名' value="{$vo.name}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label" for="name">附件：</label>
				<div class="layui-input-block">
					<div>
						{:W('FileUpload/edit',array('add_file'=>$vo['add_file']))}
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<textarea class="editor" id="content" name="content" style="width:100%;height:300px;" check="required" info="请输入内容">{$vo.content}</textarea>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<input class="btn" type="button" value="保存" id="btn_save">
					<input  class="btn btn-cancel" type="button" value="取消" onclick="go_return_url();">
				</div>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global', 'editor'], function() {
			var $ = layui.jquery;
			$("#btn_save").on('click', function() {
				send_form('form_data', "{:U('save')}", "{:U('read',array('id'=>$vo['id']))}", function() {
				});
			});
		});
	</script>
</block>